package com.prime.tutorial.moviestore.service.admin;

import com.prime.tutorial.moviestore.domain.Groups;
import com.prime.tutorial.moviestore.domain.Users;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Provides service functions for user administration <br/>
 * Created by IntelliJ IDEA.<br/>
 * Users: me<br/>
 * Date: 22 лют 2010 <br/>
 * Time: 9:31:50 <br/>
 * @author iryna.masyuk
 */
public interface AdminService {
    /**
     * Returns all available user groups
     * @return list of groups
     */
   public List<Groups> getAllGroups();

    /**
     * Returns all users
     * @return list of users
     */
   public List<Users> getAllUsers();

    /**
     * Checks whether user with this login exists in the database
     * @param login login
     * @return true if exists, false therwise
     */
   public Boolean loginExists(String login);

    /**
     * Returns gruops by name
     * @param name group name
     * @return list of Groups
     */
   public List<Groups> findByName(String name);

    /**
     * Creates new user
     * @param users user to create
     */
   @Transactional
   public void createNew(Users users);

    /**
     * Removes user
     * @param users user to remove
     */
   @Transactional
   public void deleteUser(Users users);

    /**
     * Updates user
     * @param users user to update
     */
   @Transactional
   public void updateUser(Users users);

   
}
